package com.dlsp.hotel.service.impl;;
import com.dlsp.hotel.bean.Account;
import com.dlsp.hotel.mapper.AccountMapper;
import com.dlsp.hotel.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AccountServiceImpl implements AccountService {
	@Autowired
	private AccountMapper accountMapper;


	@Override
	public int add(Account account) {
		int add = accountMapper.add(account);
		return add;
	}

	@Override
	public int edit(Account account,Integer id) {
		accountMapper.edit(account,id);
		return 0;
	}

	@Override
	public int delete(Integer id) {
		int res = accountMapper.delete(id);
		return res;
	}

	@Override
	public List<Account> findList(Map<String, Object> queryMap) {
		return null;
	}

	@Override
	public Integer getTotal(Map<String, Object> queryMap) {
		return null;
	}

	@Override
	public Account find(Long id) {
		return null;
	}

	@Override
	public Account findByName(String name) {
		Account account = accountMapper.findByName(name);

		return account;
	}

	@Override
	public Account login(String name, String upwd) {
		Account account = accountMapper.findByNameAndPwd(name, upwd);
		return account;
	}

	@Override
	public List<Account> queryAll() {
		return accountMapper.queryAll();
	}

	@Override
	public List<Account> findByNameLike(String name) {
		List<Account> accountList = accountMapper.findByNameLike(name);

		return accountList;
	}
}
